#ifndef UTILITIES_H
#define UTILITIES_H
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <string>
#include "stringtokenizer.h"
#include "matcher.h"
using namespace std;

/*****************************
Implementation of bmpSearch and computeBmpLast is taken from
http://dev-faqs.blogspot.com/2010/05/boyer-moore-algorithm.html
they are parts of Boyer Moore Algorithm, which garantees us O(n) complexity, which we are
going to use for pattern matching, compared to string.h implementation of string::find, which has worst case of O(mn)

******************************/




class Utilities
{
private:
	Matcher matcher;
public:
	Utilities();
	~Utilities();
	vector<int> computeBmpLast(const string& pattern);
	int bmpSearch(const string& text, const string& pattern,vector<int> bmpLast);
	string Utilities::convertInfixPostfix(StringTokenizer tokenizer);
};

#endif